﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ProtoXaml="clr-namespace:ProtoXaml;assembly=ProtoXaml"
    >
    
    
    <!-- GRADIENTS -->
    <LinearGradientBrush x:Key="ButtonGradient" 
                     StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="#FDB6CADF" Offset="0" />
            <GradientStop Color="#FCC3C5FF" Offset="0.1" />
            <GradientStop Color="#FCC4D0EF" Offset="0.3" />
            <GradientStop Color="#FDB7C2DF" Offset="0.6" />
            <GradientStop Color="#FE95B3CF" Offset="0.8" />
            <GradientStop Color="#FE96AACF" Offset="1" />
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="VerticalScrollGradient" 
                     StartPoint="0,0" EndPoint="1,0">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="#FDB6CADF" Offset="0" />
            <GradientStop Color="#FCC3C5FF" Offset="0.1" />
            <GradientStop Color="#FCC4D0EF" Offset="0.3" />
            <GradientStop Color="#FDB7C2DF" Offset="0.6" />
            <GradientStop Color="#FE95B3CF" Offset="0.8" />
            <GradientStop Color="#FE96AACF" Offset="1" />
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>


    <!-- SCROLLBAR TEMPLATES -->
    <Style x:Key="Scrollbar_LineButton" TargetType="{x:Type RepeatButton}">
      <Setter Property="OverridesDefaultStyle" Value="true"/>
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type RepeatButton}">            
              <ContentPresenter x:Name="ContentSite" />            
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Setter Property="Height" Value="12" />
      <Setter Property="Width" Value="12" />
      <Setter Property="Foreground" Value="Gray" />
      <Setter Property="FontSize" Value="6pt" />
      <Setter Property="FontWeight" Value="Bold" />
      <Setter Property="FontFamily" Value="Lucida Sans" />
      <Setter Property="VerticalAlignment" Value="Center" />
      <Setter Property="HorizontalAlignment" Value="Center" />
    </Style>

    <Style x:Key="ScrollBar_TrackRepeater"  TargetType="{x:Type RepeatButton}">
      <Setter Property="OverridesDefaultStyle" Value="true"/>
      <Setter Property="IsTabStop" Value="false" />
      <Setter Property="Focusable" Value="false" />
      <Setter Property="Command" Value="ScrollBar.PageUpCommand" />
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type RepeatButton}">
            <Rectangle Fill="Transparent" />
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>

    <Style x:Key="ScrollBar_UpTrack" 
           BasedOn="{StaticResource ScrollBar_TrackRepeater}" 
           TargetType="{x:Type RepeatButton}">
      <Setter Property="Command" Value="ScrollBar.PageUpCommand" />
    </Style>
    
    <Style x:Key="ScrollBar_DownTrack" 
           BasedOn="{StaticResource ScrollBar_TrackRepeater}" 
           TargetType="{x:Type RepeatButton}">
      <Setter Property="Command" Value="ScrollBar.PageDownCommand" />
    </Style>


    <Style x:Key="ScrollBar_LeftTrack" 
           BasedOn="{StaticResource ScrollBar_TrackRepeater}" 
           TargetType="{x:Type RepeatButton}">
      <Setter Property="Command" Value="ScrollBar.PageLeftCommand" />
    </Style>

    <Style x:Key="ScrollBar_RightTrack" 
           BasedOn="{StaticResource ScrollBar_TrackRepeater}" 
           TargetType="{x:Type RepeatButton}">
      <Setter Property="Command" Value="ScrollBar.PageRightCommand" />
    </Style>

    <Style x:Key="ScrollBar_VerticalThumb" TargetType="{x:Type Thumb}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Thumb}">
            <Border CornerRadius="6" 
              BorderBrush="Transparent"     
              BorderThickness="0" 
              Background="{DynamicResource VerticalScrollGradient}" />
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Setter Property="MinHeight" Value="10" />
      <Setter Property="MinWidth" Value="10" />
    </Style>

    <Style x:Key="ScrollBar_HorizontalThumb" TargetType="{x:Type Thumb}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Thumb}">
            <ProtoXaml:WigglyBorder CornerRadius="6" 
              BorderBrush="Black"     
              BorderThickness="2" 
              Background="White" />
            <!--<Border CornerRadius="6" 
              BorderBrush="Black"     
              BorderThickness="2" 
              Background="White" />-->
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>

    <Style TargetType="{x:Type ScrollBar}">
      <Setter Property="Background" Value="Transparent" />
      <Setter Property="MinWidth" Value="10" />
      <!--Define a default vertical ScrollBar template with 
          2 RepeatButtons and Track-->
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type ScrollBar}">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="12"/>
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="12" />
                <RowDefinition Height="*"/>
                <RowDefinition Height="12" />
              </Grid.RowDefinitions>
              <Border Grid.Row="1" BorderThickness="0" 
                      Background="Transparent" CornerRadius="4"/>
              <RepeatButton Grid.Row="0" 
				Style="{DynamicResource Scrollbar_LineButton}" 									
                            Command="ScrollBar.LineUpCommand" >
			<Path x:Name="Path" Width="10" Height="10"  Stretch="Fill" StrokeThickness="2" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFFFFFFF" Data="F1 M 267.333,178.667C 269.796,168.816 273.952,159.278 279.333,150.667C 280.387,148.981 281.111,147.111 282,145.333C 282.889,143.556 282.679,140 284.667,140C 286.654,140 286.28,143.648 287.333,145.333C 288.511,147.218 290.156,148.782 291.333,150.667C 296.812,159.433 300.827,169.068 304.667,178.667"/>
							</RepeatButton>
							
              
              <!--IsDirectionReversed set to true draws a ScrollBar with a 
                  Track whose lowest value is at the bottom.
                  The default orientation of a ScrollBar is for the Track
                  values to decrease from top to bottom.-->
              <Track Grid.Row="1" Name="PART_Track"
                     IsDirectionReversed="true">
                <Track.DecreaseRepeatButton>
                  <RepeatButton Style="{DynamicResource ScrollBar_UpTrack}"/>
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                  <Thumb Style="{DynamicResource ScrollBar_HorizontalThumb}"/>
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                  <RepeatButton Style="{DynamicResource ScrollBar_DownTrack}"/>
                </Track.IncreaseRepeatButton>
              </Track>
              <RepeatButton Grid.Row="2" 
                            Style="{DynamicResource Scrollbar_LineButton}" 
                            Command="ScrollBar.LineDownCommand"  >
			<Path Width="12" Stretch="Fill" StrokeThickness="2" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFFFFFFF" Data="F1 M 268.063,184.221C 270.526,195.186 274.681,205.802 280.063,215.386C 281.117,217.262 281.841,219.344 282.73,221.323C 283.619,223.301 283.409,227.259 285.397,227.259C 287.384,227.259 287.01,223.199 288.063,221.323C 289.241,219.225 290.885,217.484 292.063,215.386C 297.542,205.629 301.557,194.904 305.397,184.221"/>
		</RepeatButton>
            </Grid>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Style.Triggers>
        <Trigger Property="Orientation" Value="Horizontal" >
          <Setter Property="Background" Value="Transparent" />
          <Setter Property="MinHeight" Value="10" />
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="{x:Type ScrollBar}">
                <Grid>
                  <Grid.RowDefinitions>
                    <RowDefinition Height="12"/>
                  </Grid.RowDefinitions>
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="12" />
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="12" />
                  </Grid.ColumnDefinitions>
                  <Border Grid.Column="1" BorderThickness="0" 
                        Background="Transparent" CornerRadius="4"/>
                  <RepeatButton Grid.Column="0" 
                                Style="{DynamicResource Scrollbar_LineButton}" 									
                                Command="ScrollBar.LineLeftCommand" Content=" &lt;" />
                  <Track Grid.Column="1" Name="PART_Track">
                    <Track.DecreaseRepeatButton>
                      <RepeatButton Style="{DynamicResource ScrollBar_LeftTrack}"/>
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                      <Thumb Style="{DynamicResource ScrollBar_HorizontalThumb}"/>
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                      <RepeatButton Style="{DynamicResource ScrollBar_RightTrack}"/>
                    </Track.IncreaseRepeatButton>
                  </Track>
                  <RepeatButton Grid.Column="2" 
                                Style="{DynamicResource Scrollbar_LineButton}" 									
                                Command="ScrollBar.LineRightCommand" Content=" &gt;" />
                </Grid>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Trigger>
      </Style.Triggers>
    </Style>

    <!-- BUTTON TEMPLATE -->
    <!--
    <Style x:Key="[System.Windows.Controls.Button default]" TargetType="{x:Type Button}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Border x:Name="OuterBorder"
              CornerRadius="3" 
              Background="{DynamicResource ButtonGradient}">
              <Border
                x:Name="InnerBorder"
                CornerRadius="3"
                Background="#33000000"
                Padding="{TemplateBinding Padding}">
                <ContentPresenter x:Name="ContentSite" 
                HorizontalAlignment="Center" 
                VerticalAlignment="Center" />
              </Border>
            </Border>
            <ControlTemplate.Triggers>
              <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="InnerBorder" Property="Background" 
                        Value=" #200F0000" />
              </Trigger>
              <Trigger Property="IsEnabled" Value="false">
                <Setter TargetName="InnerBorder" Property="Background" 
                        Value="#40201040"  />
                <Setter Property="BorderBrush" Value="Silver"  />
                <Setter Property="Foreground" Value="SlateGray"  />
              </Trigger>
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Setter Property="Height" Value="18" />
      <Setter Property="Foreground" Value="MidnightBlue" />
    </Style>-->

    
</ResourceDictionary>